package com.wch.demo.configfile.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import com.wch.demo.configfile.base.YamlPropertySourceFactory;

/**
 * 测试yml文件读取
 * 在这里配置prefix,但是貌似时没用，还需要进行测试
 * @author 19821
 *
 */
@Component
@ConfigurationProperties(prefix="baseinfo")
//@PropertySource("classpath:define.yml")
@PropertySource(value = {"classpath:define.yml"}, factory = YamlPropertySourceFactory.class)
public class DefineYml {

	/*
	@Value("${shop.name}")
    private String name;*/
	
	@Value("${baseinfo.name}")
	private String baseName;
	
	@Value("${baseinfo.sex}")
	private String baseSex;
	
	@Value("${baseinfo.age}")
	private String baseAge;
/*	
	@Value("${moreinfo.addr}")
	private String addr;
	
	@Value("${moreinfo.hobby}")
	private String hobby;*/

	/*public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}*/

	public String getBaseName() {
		return baseName;
	}

	public void setBaseName(String baseName) {
		this.baseName = baseName;
	}

	public String getBaseSex() {
		return baseSex;
	}

	public void setBaseSex(String baseSex) {
		this.baseSex = baseSex;
	}

	public String getBaseAge() {
		return baseAge;
	}

	public void setBaseAge(String baseAge) {
		this.baseAge = baseAge;
	}

/*	public String getAddr() {
		return addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	public String getHobby() {
		return hobby;
	}

	public void setHobby(String hobby) {
		this.hobby = hobby;
	}
	*/
	
	
}
